function gets(pageNum) {
    var pageN = pageNum;
    $("#pageNum").val(pageN);
    var serializeArray = $("#commentsAdd").serializeArray();
    $.ajax({
            url: '/myspringboot/Settleaccounts/findJieSuanDanAdd',
            type: 'post',
            dataType: "json",
            data: serializeArray,
            success: function (result) {
                var result = result.data;
                yibu(result.pages, result.pageNum);
                var list = result.list;
                $(".a").empty();
                for (var i = 0; i < list.length; i++) {
                    var a = i + 1;
                    var state = list[i].state;
                    var ssettlementAmount = list[i].ssettlementAmount;
                    var drugAtegory = list[i].drugAtegory;
                    if (drugAtegory != null) {
                        var daName = drugAtegory.daName;
                    }
                    var purchaseOrder = list[i].purchaseOrder;
                    if (purchaseOrder != null) {
                        //订单编号
                        var poNumber = purchaseOrder.poNumber;
                        var poName = purchaseOrder.poName;
                        var poStateTime = purchaseOrder.poStateTime;
                        var poEndTime = purchaseOrder.poEndTime;
                    }
                    var drugInformation = list[i].drugInformation;
                    if (drugInformation != null) {
                        var diId = drugInformation.diId;
                        //药品流水号
                        var diNumer = drugInformation.diNumer;
                        //通用名
                        var diName = drugInformation.diName;
                        //剂型
                        var diForm = drugInformation.diForm;
                        //规格
                        var diSpecifications = drugInformation.diSpecifications;
                        //单位
                        var diUnit = drugInformation.diUnit;
                        //转换系数
                        var diCc = drugInformation.diCc;
                        //交易价
                        var diNewPrice = drugInformation.diNewPrice;
                        //中标价
                        var diBiddingPrice = drugInformation.diBiddingPrice;
                    } else {
                         diNumer = "null"
                         diName = "null"
                         diForm = "null"
                         diSpecifications = "null"
                         diUnit = "null"
                         diCc = "null"
                         diNewPrice = "null"
                    }
                    var putInStorage = list[i].putInStorage;
                    if (putInStorage != null) {
                        var psNumber = putInStorage.psNumber;
                        var psPihao = putInStorage.psPihao;
                        var psUsefulLife = putInStorage.psUsefulLife;
                    }else {
                        psNumber="null"
                        psPihao="null"
                        psUsefulLife="null"
                    }
                    //中间表
                    var nn="-"
                    var podiPd = list[i].podiPd;
                    if (podiPd != null) {
                        var podiId = podiPd.podiId;
                        var podiOrder = podiPd.podiOrder;
                        var podiOrderTotal = podiPd.podiOrderTotal;
                        var podiTotal = podiPd.podiTotal;
                        var podiReturn = podiPd.podiReturn;
                        var podiReturnTotal = podiPd.podiReturnTotal;
                        var podiSettlement = podiPd.podiSettlement;
                        var podiSettlementTotal = podiPd.podiSettlementTotal;
                    }else {
                        podiOrder="null"
                        podiOrderTotal="null"
                        podiTotal="null"
                        podiReturn="null"
                        podiReturnTotal="null"
                        podiSettlement="null"
                        podiSettlementTotal="null"
                    }

                    //生产企业
                    var manufacturer = list[i].manufacturer;
                    if (manufacturer != null) {
                        var mfName = manufacturer.mfName;
                    }
                    //采购医院
                    var hospital = list[i].hospital;
                    if (hospital != null) {
                        var hName = hospital.hName;
                    } else {
                         hName = "null"
                    }
                    var drugQualityLevel = list[i].drugQualityLevel;
                    if (drugQualityLevel != null) {
                        var dqlName = drugQualityLevel.dqlName;
                    } else {
                        var dqlName = "null"
                    }
                    var tr = '<tr>' +
                        '<td>' + a + '</td>' +
                        '<td><input class="selectItem1" name="sdiId" value=' +diId+nn+podiId+ ' type="checkbox">' +
                        '<td>' + poNumber + '</td>' +
                        '<td>' + poName + '</td>' +
                        '<td>' + diNumer + '</td>' +
                        '<td>' + diName + '</td>' +
                        '<td>' + daName + '</td>' +
                        '<td>' + diBiddingPrice + '</td>' +
                        '<td>' + diNewPrice + '</td>' +
                        '<td>' + podiOrder + '</td>' +
                        '<td>' + podiOrderTotal + '</td>' +
                        '<td>' + podiTotal + '</td>' +
                        '<td>' + psNumber + '</td>' +
                        '<td>' + psPihao + '</td>' +
                        '<td>' + psUsefulLife + '</td>' +
                        '<td>' + podiReturn + '</td>' +
                        '<td>' + podiReturnTotal + '</td>' +
                        '<td>' + podiSettlement + '</td>' +
                        '<td>' + podiSettlementTotal + '</td>' +
                        '<td>' + ssettlementAmount + '</td>' +
                        '<td>' + diForm + '</td>' +
                        '<td>' + diSpecifications + '</td>' +
                        '<td>' + diUnit + '</td>' +
                        '<td>' + diCc + '</td>' +
                        '<td>' + dqlName + '</td>' +
                        '<td>' + mfName + '</td>' +
                        '<td>' + mfName + '</td>' +
                        '<td>' + poStateTime + '</td>' +
                        '<td>' + poEndTime + '</td>' +
                        '<td>' + state + '</td>' +
                        '<td>' + '<a>查看</a>' + '</td>' +
                        '</tr>'
                    $(".a").append(tr);
                }
            }
        }
    )
}


//全选
function selectAll(obj) {
    var checkboxEle = document.getElementsByClassName("selectItem1");
    for (var i = 0; i < checkboxEle.length; i++) {
        checkboxEle[i].checked = obj.checked;
    }
}

//获取复选框的值
function show() {
    var ssid = $("#ssid").val();
    obj1 = document.getElementsByClassName("selectItem1");
    var sdiI = [];
    for (k in obj1) {
        if (obj1[k].checked)
            sdiI.push(obj1[k].value);
    }
    $.ajax({
        url: '/myspringboot/SettlementController/statementAddDi',
        type: 'post',
        dataType: 'json',
        traditional: true,
        data: {
            id: sdiI,
            ssId:ssid,
        },
        success: function (result) {
            alert(result.msg)
        }
    })
}